package cn.chrilwe.pigpig.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.chrilwe.pigpig.core.model.user.Role;
import cn.chrilwe.pigpig.core.model.user.RoleAuth;

/**
 * 
 * @author chrilwe 2020-8-8
 */
public interface RoleMapper {

	public void insertRole(Role roles);

	public void insertRoleAuth(RoleAuth roleAuth);

	public List<Role> selectAll(@Param("userId") int userId, @Param("begin") int begin, @Param("size") int size);
	
	public Role selectById(int roleId);
	
	public List<Role> selectRolesByUserId(int userId);
	
	public void updateRoleAuth(RoleAuth roleAuth);
	
	public RoleAuth selectRoleAuthByRoleId(int roleId);
	
	public void deleteRoleAuthByAuthId(int authId);
	
	public Role selectRoleByName(String name);
}
